﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Medical.Entity;
using Medical.Business;
using System.Data;

/// <summary>
/// 设备页面
/// </summary>
public partial class Equipment : WebPage
{
    protected DataTable dtMeta = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DataRow[] drList = Until.GetSEO().Select("Type=5");
            if (drList.Length > 0)
                SetPageInfo(drList[0]["PageTitle"].ToString() == string.Empty ? ("高端设备_" + strWebTitle) : drList[0]["PageTitle"].ToString(), drList[0]["PageKeywords"].ToString(), drList[0]["PageDescription"].ToString());
            InitData();
        }
    }

    /// <summary>
    /// 数据初始化
    /// </summary>
    protected void InitData()
    {
        BisArticle bisArticle = new BisArticle();
        //设备
        DataTable dtEquipment = bisArticle.GetAllArticle(ArticelTypeEnum.Equipment);
        rptEquipment.DataSource = dtEquipment;
        rptEquipment.DataBind();
    }

    /// <summary>
    /// 列表绑定处理
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void rptEquipment_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        DataTable dtSort = (DataTable)((Repeater)sender).DataSource;
        Literal ltlInfo = e.Item.FindControl("ltlInfo") as Literal;
        string strInfo = strInfo = Common.NoHTML(dtSort.Rows[e.Item.ItemIndex]["Info"].ToString());
        ltlInfo.Text = (strInfo.Length > 80 ? strInfo.Substring(0, 80) : strInfo) + "…";
    }
}